import { Component, AssetManager  } from 'kokomi.js';
import { EquirectangularReflectionMapping } from 'three';
import TestObject from '@/experience/world/TestObject';
import type Experience  from '../Experience';

export default class World extends Component{

    declare base: Experience;

    public testObject?: TestObject;

    constructor(base: Experience){
        super(base);

        this.base.am.on('ready', () => {
            // 天空盒
            const skybox = this.base.am.items['skybox'];
            if(skybox){
                skybox.mapping = EquirectangularReflectionMapping;
                this.base.scene.background = skybox;
            }

            this.testObject = new TestObject(this.base);
            this.testObject.addExisting();

        });
        
    }
}